package com.zxc.services.impl;

import com.zxc.dao.EmpMapper;
import com.zxc.entity.Emp;
import com.zxc.services.EmpServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

/**
  * @author: zxc
  * @return:
  * @time:  2021/5/18 11:06
  * @description:
  */
@Service("empServices")
public class EmpServicesImpl implements EmpServices {
    @Autowired
    private EmpMapper empMapper;

    @Override
    public List<Emp> getAll() {
        return empMapper.getAll();
    }

    @Override
    public int delEmp(int eno) {
        if (eno>0){
            return empMapper.delEmp(eno);
        }
        return 0;
    }

    @Override
    public int addEmp(Emp emp) {
        if (emp != null){
            return empMapper.addEmp(emp);
        }
        return 0;
    }

    @Override
    public int updateEmp(Emp emp) {
        if (emp != null) {
            return empMapper.updateEmp(emp);
        }
        return 0;
    }

    public EmpMapper getEmpMapper() {
        return empMapper;
    }
    public void setEmpMapper(EmpMapper empMapper) {
        this.empMapper = empMapper;
    }
}
